package com.xintoucloud.gsv.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.xintoucloud.gsv.entity.RolePermission;
import com.xintoucloud.gsv.model.MenuRoleVo;


public interface RolePermissionMapper {
	@Select("select * from t_role_permission where rpid=#{rpid}")
	RolePermission getOneById(@Param("rpid")int rpid);
	
	@Select("select * from t_role_permission")
	List<RolePermission> list();
	
	//根据rid(不同权限),查询要显示的菜单
	@Select("select mr.id,m.menuName,m.id menuId,m.parentId from t_menu_role mr join t_menu m on (mr.menu_id=m.id) and mr.state=1 and mr.role_id=#{rid} and m.parentId=#{parentId};")
	List<MenuRoleVo> menuZeroParentIdListByRid(@Param("rid")int rid, @Param("parentId")int parentId);
}
